from time import sleep

from selenium import webdriver
from selenium.webdriver.common.by import By


driver = webdriver.Chrome()  # 创建 Chrome 浏览器实例
driver.get("http://192.168.1.138/ranzhi/www/sys/index.html")  # 打开网页
# 1设置浏览器大小
# driver.set_window_size(500,500)
# 2最大化
driver.maximize_window()
# 3最小化
# driver.minimize_window()
# 4 前进 和 后退
driver.find_element(By.ID,"kw").send_keys("陈冠希")
driver.find_element(By.ID,"su").click()
driver.back()
driver.forward()
print((driver.title))
print((driver.current_url))
sleep(5)